﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Logic.ClarizenSvc;

namespace Logic.ClarizenObjects
{
    public class RegularResourceLink: BaseObject
    {
        public GenericEntity Resource { get; set; }
        [Clarizen(Editable=false, Selectable=true)]
        public String Resource_Name { get; set; }

        public GenericEntity WorkItem { get; set; }

        public double? PercentCompleted { get; set; }
        [Clarizen]
        public Duration ActualEffort
        {
            get
            {
                if (UpdatedFromTimeSheets)
                    return ActualOvertimeEffort + ActualRegularEffort;
                else
                    return ActualRegularEffort;
            }
        }
        [Clarizen]
        public Boolean UpdatedFromTimeSheets { get; set;}

        public Duration ActualOvertimeEffort { get; set; }
        public Duration ActualRegularEffort { get; set; }
        public Duration RemainingEffort { get; set; }
    }
}
